# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpec do
  @moduledoc """
  Represents specification of a Study.

  ## Attributes

  *   `algorithm` (*type:* `String.t`, *default:* `nil`) - The search algorithm specified for the Study.
  *   `convexAutomatedStoppingSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec.t`, *default:* `nil`) - The automated early stopping spec using convex stopping rule.
  *   `decayCurveStoppingSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecDecayCurveAutomatedStoppingSpec.t`, *default:* `nil`) - The automated early stopping spec using decay curve rule.
  *   `measurementSelectionType` (*type:* `String.t`, *default:* `nil`) - Describe which measurement selection type will be used
  *   `medianAutomatedStoppingSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecMedianAutomatedStoppingSpec.t`, *default:* `nil`) - The automated early stopping spec using median rule.
  *   `metrics` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecMetricSpec.t)`, *default:* `nil`) - Required. Metric specs for the Study.
  *   `observationNoise` (*type:* `String.t`, *default:* `nil`) - The observation noise level of the study. Currently only supported by the Vertex AI Vizier service. Not supported by HyperparameterTuningJob or TrainingPipeline.
  *   `parameters` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpec.t)`, *default:* `nil`) - Required. The set of parameters to tune.
  *   `studyStoppingConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecStudyStoppingConfig.t`, *default:* `nil`) - Conditions for automated stopping of a Study. Enable automated stopping by configuring at least one condition.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :algorithm => String.t() | nil,
          :convexAutomatedStoppingSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec.t()
            | nil,
          :decayCurveStoppingSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecDecayCurveAutomatedStoppingSpec.t()
            | nil,
          :measurementSelectionType => String.t() | nil,
          :medianAutomatedStoppingSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecMedianAutomatedStoppingSpec.t()
            | nil,
          :metrics =>
            list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecMetricSpec.t())
            | nil,
          :observationNoise => String.t() | nil,
          :parameters =>
            list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpec.t())
            | nil,
          :studyStoppingConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecStudyStoppingConfig.t()
            | nil
        }

  field(:algorithm)

  field(:convexAutomatedStoppingSpec,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec
  )

  field(:decayCurveStoppingSpec,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecDecayCurveAutomatedStoppingSpec
  )

  field(:measurementSelectionType)

  field(:medianAutomatedStoppingSpec,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecMedianAutomatedStoppingSpec
  )

  field(:metrics,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecMetricSpec,
    type: :list
  )

  field(:observationNoise)

  field(:parameters,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpec,
    type: :list
  )

  field(:studyStoppingConfig,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecStudyStoppingConfig
  )
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpec do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpec.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
